package com.ck.xs.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static java.lang.Character.UnicodeBlock.*;

/**
 * 检测工具类
 * @author xiaosun
 */
public class CheckUtil {
    private static final Logger LOGGER = LoggerFactory.getLogger(CheckUtil.class);
    /**
     * 判断字符是否为空
     * 如果为空则返回true,否则返回false
     * @param str 待检测字符
     * @return
     */
    public static boolean isNull(String... str) {
        boolean flog = false;
        try {
            if (null == str) {
                flog = true;
            }
            for (String text : str) {
                if (null == text || "".equals(text) || "null".equals(text) || "NULL".equals(text)
                        || "" == text || "" == text.trim() || "".equals(text.trim())) {
                    flog = true;
                    break;
                }
            }
        } catch (Exception e) {
            return false;
        }
        return flog;
    }




    private static boolean checkCharContainChinese(char checkChar){
        Character.UnicodeBlock ub = Character.UnicodeBlock.of(checkChar);
        if(CJK_UNIFIED_IDEOGRAPHS == ub || CJK_COMPATIBILITY_IDEOGRAPHS == ub || CJK_COMPATIBILITY_FORMS == ub ||
                CJK_RADICALS_SUPPLEMENT == ub || CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A == ub || CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B == ub){
            return true;
        }
        return false;
    }
    public static void main(String[] args){
//        System.out.println(CheckUtil.checkStringContainChinese("13.14"));
//        System.out.println(SysUtil.distancePriceTime("00:00:00"));
    }
}
